package com.backend.werewolfkillingbackend.pojo;

import com.backend.werewolfkillingbackend.model.MessageType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;

@Data
public class Message implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField(value = "content")
    private String content;

    @TableField(value = "player_name")
    private String playerName;

    @TableField(value = "room_id")
    private Long roomId;

    @TableField(value = "player_id")
    private Long playerId;

    @TableField(value = "message_type")
    private MessageType messageType;

    @TableField(value = "msg")
    private String msg;

    @TableField(exist = false)
    private Player player;

    public Message(String content, Long room_id, MessageType message_type) {
        this.content = content;
        this.roomId = room_id;
        this.messageType = message_type;
    }

    public Message(String content, Long room_id, Long player_id, String player_name, MessageType message_type) {
        this.content = content;
        this.roomId = room_id;
        this.playerId = player_id;
        this.playerName = player_name;
        this.messageType = message_type;
    }

    public Message() {

    }
}
